package com.java.module.fire.controller.api;

import com.java.common.lang.annotation.Log;
import com.java.common.lang.domain.AjaxResult;
import com.java.common.lang.enums.BusinessTypeEnum;
import com.java.common.service.ApiTokenService;
import com.java.common.utils.WebKit;
import com.java.module.fire.domain.Apply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.java.module.fire.service.IApplyService;

/**
 * 报名Controller
 * 
 * @author Administrator
 * @date 2025-02-10
 */
@RestController("ApiApplyController")
@RequestMapping("/fire/apply")
public class ApplyController {

    @Autowired
    ApiTokenService apiTokenService;

    @Autowired
    IApplyService applyService;


    /**
     * 新增报名
     */
    @PostMapping("/submit")
    public AjaxResult submit(@RequestBody Apply apply) {
        apply.setUid(apiTokenService.getLoginUserId());
        return WebKit.toAjax(applyService.insertApply(apply));
    }


}